<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>耗材登记——耗材管理——收发人员——鑫四合珠宝管理</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="huyuzhu">
<!-- Le styles -->
<link href="${pageContext.request.contextPath}/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="${pageContext.request.contextPath}/css/base.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/css/main.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap-affix.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap-modal.js"></script>
<script type="text/javascript">
<s:if test="message!=null">
	$(document).ready(function(){
		$("#myModal").modal('show');
	});
</s:if>
	function add(){
		var staffName = $.trim($("#staffName").val());
		if(staffName==""){
			$("#StaffNameMsg").html("请输入领用人!");
			return false;
		}
		var quantity = $.trim($("#quantity").val());
		if(quantity==""){
			$("#QuantityMsg").html("请输入领用数量!");
			return false;
		}
		
		$("#AddForm").submit();
	}
	
	function categoryChange(){
		if($("#category").val()==1){
			$("#title1").html("入库人：");
			$("#title2").html("入库数量：");
		}else{//领用人：
			$("#title1").html("领用人：");
			$("#title2").html("领用数量：");
		}
	}
	
	function clear(){
		$("#StaffNameMsg").html("");
		$("#QuantityMsg").html("");
		
	}
</script>

</head>
<body>
<!-- 头部 -->
<s:include value="../header.jsp"/>
<!-- 主内容区开始 -->
<div class="conBox clearfix">
   <s:if test="#session.UserInfo.userVO.userType==1">
	<s:include value="../a/menu.jsp">
	<s:param name="menuIndex" value="5"/>
</s:include>
</s:if>
<s:else>
<s:include value="menu.jsp">
	<s:param name="menuIndex" value="5"/>
</s:include>
</s:else>
  <div class="mainBox">
    <h1>耗材登记</h1>
    <s:form action="addingConsumablesLog" id="AddForm" cssClass="form-horizontal">
      <div class="control-group">
        <label class="control-label">类别：</label>
        <div class="controls">
          <select name="consumablesLog.category" id="category" onchange="categoryChange();"  class="span2">
            <option value="1">入库</option>
            <option value="2">领用</option>
          </select>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label">耗材类型：</label>
        <div class="controls">
         <s:select name="consumablesLog.consumablesid" list="consumablesList" listKey="consumablesid" cssClass="w150" listValue="consumablesName"/>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="staffName"><span id="title1">入库人：</span></label>
        <div class="controls">
          <s:textfield id="staffName" name="consumablesLog.staffName"/><span id="StaffNameMsg" class="help-inline tred"></span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="quantity"><span id="title2">入库数量：</span></label>
        <div class="controls">
          <s:textfield id="quantity" name="consumablesLog.quantity"/><span id="QuantityMsg" class="help-inline tred"></span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="handlePerson">经手：</label>
        <div class="controls">
          <span class="uneditable-input">何总</span>
          <s:hidden name="consumablesLog.handlePerson" value="何总"/>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label">：</label>
        <div class="controls">
          <s:textarea name="consumablesLog.handlePerson" rows="5" cssClass="input-xlarge" id="Remark"/>
        </div>
      </div>
      <div class="form-actions">
          <input type="button" class="btn btn-primary"  value="保存" onclick="add();"/>
          <s:reset cssClass="btn" value="重置"/>
        <s:a action="queryConsumablesList" cssClass="btn">返回</s:a>
      </div>
    </s:form>
  </div>
</div>
<!-- 主内容区结束 --> 
<!-- 尾部 -->
<s:include value="../bottom.jsp"/>


<div class="modal hide fade" id="myModal">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>操作提示</h3>
  </div>
  <div class="modal-body">
    <p><s:property  value="message"/></p>
  </div>
  <div class="modal-footer">
    <a href="#" class="btn btn-primary" data-dismiss="modal">确定</a>
  </div>
</div>

</body>
</html>